-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Real time render with SFML #107
Open
ilyabrilev
wants to merge
62
commits into
davidrmiller:main
Choose a base branch
from
ilyabrilev:pr-to-davidrmiller-repo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature/profiling and refactoring
view refactoring (full sfml support)
speed control ui
Multithreading fix and refactoring
save system v1 is finaly done
binary saves and autosave checkbox
StopAtStart and StopAtEnd buttons
restart on end button
Save simulation
right panel refactoring
info button
survival criteria info button
add comments to functions
@ilyabrilev, this is awesome. Very nice improvements. I'm going to decline pulling your work into this repo only because I'm trying to transition it into maintenance-only mode. Instead, I've added a shout-out and a link to your fork in the README.md file (if you'd like that reference worded any differently, let me know). Thanks for your impressive work on this. |
That is ideal, thank you very much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, @davidrmiller. Thank you for this awesome repository. I've created a fork that might be worth checking out. To get the glimpse on how it looks like, you can check screenshot.png in the root directory.
The main idea is to render simulation in real time rather than in the form of video files. With real time render simulation feels more alive, debugging is easier, and it opens whole lot more possibilities to observe and interact with the simulation. I've also tried to preserve existing functionality, so my PR has no innovative ideas, it's almost pure cosmetic that can be turned of.
Here is a brief list of changes:
But first I've done some refactoring to prevent codebase from bloating because of the amount of additional files and to make it more suitable to the new flow.
simulator
function) is used for top-level initialization and main application loop. Main simulation loop was extracted into newsimulate
function.userio
is grouping together everything related to input and output. ClassUserIO
is an entry point. It is called at specific points of simulation life cycle and passes it toSFMLUserIO
and/orImageWriter
depending on which were enabled at the construction ofUserIO
.ImageWriter
has not undergone any changes.SFMLUserIO
is the main class for real life render. Display loop and event handling are done in this class. It also includes main window, view, all custom display components and child windows. All custom components are stored insfmlComponents
directory and created bySFMLUserIO
with a heavy use of callback functions. Responsibility of custom components is to display UI, hey don't usually interact with simulation logic directly.survivalCriteria
directory is where all challenges logic placed. It containsSurvivalCriteriaManager
- a class that other parts of application are interacting with, andSurvivalCriteria
successor classes that handles if certain indiv passes a criteria as well as displaying the criteria. The idea behind splitting criterias into dedicated classes was to make creating/disabling/enabling new challenges as easy as possible.ai
directory contains everything related to genomes, indivs, signals, etc. No major changes hereutils
contains logic that not directly related to simulation, like: analysis, profiling tool, random number generator, and save/load system. save/load system uses cereal library which under the hood callsserialize
function added forParams
,Peeps
andIndiv
. Cereal library is located insideinclude
library.Output
directory. This includes:Application was tested on Linux Mint 21.3
New requirements are:
My solution is far from being perfect. UI needs more polishing, there are not enough space for all settings and buttons. Performance was not a first priority, so there is probably a lot that can be done on that front. Building inside a docker container also stopped working, I assume because it doesn't support SFML.